Optimal. Leaf size=102 \[ \frac {3 a^2 x}{4}-\frac {2 a^2 \cos (e+f x)}{f}+\frac {a^2 \cos ^3(e+f x)}{f}-\frac {a^2 \cos ^5(e+f x)}{5 f}-\frac {3 a^2 \cos (e+f x) \sin (e+f x)}{4 f}-\frac {a^2 \cos (e+f x) \sin ^3(e+f x)}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2836, 2713,
2715, 8} \begin {gather*} -\frac {a^2 \cos ^5(e+f x)}{5 f}+\frac {a^2 \cos ^3(e+f x)}{f}-\frac {2 a^2 \cos (e+f x)}{f}-\frac {a^2 \sin ^3(e+f x) \cos (e+f x)}{2 f}-\frac {3 a^2 \sin (e+f x) \cos (e+f x)}{4 f}+\frac {3 a^2 x}{4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 2836
Rubi steps
\begin {align*} \int \sin ^3(e+f x) (a+a \sin (e+f x))^2 \, dx &=\int \left (a^2 \sin ^3(e+f x)+2 a^2 \sin ^4(e+f x)+a^2 \sin ^5(e+f x)\right ) \, dx\\ &=a^2 \int \sin ^3(e+f x) \, dx+a^2 \int \sin ^5(e+f x) \, dx+\left (2 a^2\right ) \int \sin ^4(e+f x) \, dx\\ &=-\frac {a^2 \cos (e+f x) \sin ^3(e+f x)}{2 f}+\frac {1}{2} \left (3 a^2\right ) \int \sin ^2(e+f x) \, dx-\frac {a^2 \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (e+f x)\right )}{f}-\frac {a^2 \text {Subst}\left (\int \left (1-2 x^2+x^4\right ) \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {2 a^2 \cos (e+f x)}{f}+\frac {a^2 \cos ^3(e+f x)}{f}-\frac {a^2 \cos ^5(e+f x)}{5 f}-\frac {3 a^2 \cos (e+f x) \sin (e+f x)}{4 f}-\frac {a^2 \cos (e+f x) \sin ^3(e+f x)}{2 f}+\frac {1}{4} \left (3 a^2\right ) \int 1 \, dx\\ &=\frac {3 a^2 x}{4}-\frac {2 a^2 \cos (e+f x)}{f}+\frac {a^2 \cos ^3(e+f x)}{f}-\frac {a^2 \cos ^5(e+f x)}{5 f}-\frac {3 a^2 \cos (e+f x) \sin (e+f x)}{4 f}-\frac {a^2 \cos (e+f x) \sin ^3(e+f x)}{2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.29, size = 105, normalized size = 1.03 \begin {gather*} -\frac {a^2 \cos (e+f x) \left (30 \sin ^{-1}\left (\frac {\sqrt {1-\sin (e+f x)}}{\sqrt {2}}\right )+\sqrt {\cos ^2(e+f x)} \left (24+15 \sin (e+f x)+12 \sin ^2(e+f x)+10 \sin ^3(e+f x)+4 \sin ^4(e+f x)\right )\right )}{20 f \sqrt {\cos ^2(e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.29, size = 96, normalized size = 0.94
method | result | size |
risch | \(\frac {3 a^{2} x}{4}-\frac {11 a^{2} \cos \left (f x +e \right )}{8 f}-\frac {a^{2} \cos \left (5 f x +5 e \right )}{80 f}+\frac {a^{2} \sin \left (4 f x +4 e \right )}{16 f}+\frac {3 a^{2} \cos \left (3 f x +3 e \right )}{16 f}-\frac {a^{2} \sin \left (2 f x +2 e \right )}{2 f}\) | \(90\) |
derivativedivides | \(\frac {-\frac {a^{2} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5}+2 a^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-\frac {a^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(96\) |
default | \(\frac {-\frac {a^{2} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5}+2 a^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-\frac {a^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(96\) |
norman | \(\frac {\frac {3 a^{2} x}{4}-\frac {12 a^{2}}{5 f}-\frac {3 a^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 f}-\frac {7 a^{2} \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {7 a^{2} \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {3 a^{2} \left (\tan ^{9}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}+\frac {15 a^{2} x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4}+\frac {15 a^{2} x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}+\frac {15 a^{2} x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}+\frac {15 a^{2} x \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4}+\frac {3 a^{2} x \left (\tan ^{10}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4}-\frac {4 a^{2} \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {20 a^{2} \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {12 a^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{5}}\) | \(248\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.36, size = 103, normalized size = 1.01 \begin {gather*} -\frac {16 \, {\left (3 \, \cos \left (f x + e\right )^{5} - 10 \, \cos \left (f x + e\right )^{3} + 15 \, \cos \left (f x + e\right )\right )} a^{2} - 80 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a^{2} - 15 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2}}{240 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 89, normalized size = 0.87 \begin {gather*} -\frac {4 \, a^{2} \cos \left (f x + e\right )^{5} - 20 \, a^{2} \cos \left (f x + e\right )^{3} - 15 \, a^{2} f x + 40 \, a^{2} \cos \left (f x + e\right ) - 5 \, {\left (2 \, a^{2} \cos \left (f x + e\right )^{3} - 5 \, a^{2} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{20 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 221 vs.
\(2 (94) = 188\).
time = 0.31, size = 221, normalized size = 2.17 \begin {gather*} \begin {cases} \frac {3 a^{2} x \sin ^{4}{\left (e + f x \right )}}{4} + \frac {3 a^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{2} + \frac {3 a^{2} x \cos ^{4}{\left (e + f x \right )}}{4} - \frac {a^{2} \sin ^{4}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {5 a^{2} \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{4 f} - \frac {4 a^{2} \sin ^{2}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac {a^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {3 a^{2} \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{4 f} - \frac {8 a^{2} \cos ^{5}{\left (e + f x \right )}}{15 f} - \frac {2 a^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} & \text {for}\: f \neq 0 \\x \left (a \sin {\left (e \right )} + a\right )^{2} \sin ^{3}{\left (e \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.56, size = 94, normalized size = 0.92 \begin {gather*} \frac {3}{4} \, a^{2} x - \frac {a^{2} \cos \left (5 \, f x + 5 \, e\right )}{80 \, f} + \frac {3 \, a^{2} \cos \left (3 \, f x + 3 \, e\right )}{16 \, f} - \frac {11 \, a^{2} \cos \left (f x + e\right )}{8 \, f} + \frac {a^{2} \sin \left (4 \, f x + 4 \, e\right )}{16 \, f} - \frac {a^{2} \sin \left (2 \, f x + 2 \, e\right )}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 10.28, size = 225, normalized size = 2.21 \begin {gather*} \frac {3\,a^2\,x}{4}-\frac {\frac {3\,a^2\,\left (e+f\,x\right )}{4}+7\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3-7\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7-\frac {3\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^9}{2}-\frac {a^2\,\left (15\,e+15\,f\,x-48\right )}{20}+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6\,\left (\frac {15\,a^2\,\left (e+f\,x\right )}{2}-\frac {a^2\,\left (150\,e+150\,f\,x-80\right )}{20}\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {15\,a^2\,\left (e+f\,x\right )}{4}-\frac {a^2\,\left (75\,e+75\,f\,x-240\right )}{20}\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (\frac {15\,a^2\,\left (e+f\,x\right )}{2}-\frac {a^2\,\left (150\,e+150\,f\,x-400\right )}{20}\right )+\frac {3\,a^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{2}}{f\,{\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}^5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________